/* eslint-disable object-curly-spacing */
/* eslint-disable indent */
'use strict';


const Controller = require('egg').Controller;

class UserController extends Controller {
    async index() {
        const { ctx } = this;
        const { username } = ctx.query;

        ctx.body = username;

    }
    // eslint-disable-next-line space-before-blocks
    async getid() {
        // eslint-disable-next-line object-curly-spacing
        const { ctx } = this;
        const { id } = ctx.params;
        ctx.body = id;
    }
    async add() {
        const { ctx } = this;
        const { title, content } = await ctx.service.user.user();
        ctx.body = {
            title,
            content,
        };
    }

}

module.exports = UserController;
